Multi-objective energy management in a renewable and EV-integrated microgrid using an iterative map-based self-adaptive crystal structure algorithm

The use of plug-in hybrid electric vehicles (PHEVs) provides a way to address energy and environmental issues. Integrating a large number of PHEVs with advanced control and storage capabilities can enhance the flexibility of the distribution grid. This study proposes an innovative energy management strategy (EMS) using an Iterative map-based self-adaptive crystal structure algorithm (SaCryStAl) specifically designed for microgrids with renewable energy sources (RESs) and PHEVs. The goal is to optimize multi-objective scheduling for a microgrid with wind turbines, micro-turbines, fuel cells, solar photovoltaic systems, and batteries to balance power and store excess energy. The aim is to minimize microgrid operating costs while considering environmental impacts. The optimization problem is framed as a multi-objective problem with nonlinear constraints, using fuzzy logic to aid decision-making. In the first scenario, the microgrid is optimized with all RESs installed within predetermined boundaries, in addition to grid connection. In the second scenario, the microgrid operates with a wind turbine at rated power. The third case study involves integrating plug-in hybrid electric vehicles (PHEVs) into the microgrid in three charging modes: coordinated, smart, and uncoordinated, utilizing standard and rated RES power. The SaCryStAl algorithm showed superior performance in operation cost, emissions, and execution time compared to traditional CryStAl and other recent optimization methods. The proposed SaCryStAl algorithm achieved optimal solutions in the first scenario for cost and emissions at 177.29 €ct and 469.92 kg, respectively, within a reasonable time frame. In the second scenario, it yielded optimal cost and emissions values of 112.02 €ct and 196.15 kg, respectively. Lastly, in the third scenario, the SaCryStAl algorithm achieves optimal cost values of 319.9301 €ct, 160.9827 €ct and 128.2815 €ct for uncoordinated charging, coordinated charging and smart charging modes respectively. Optimization results reveal that the proposed SaCryStAl outperformed other evolutionary optimization algorithms, such as differential evolution, CryStAl, Grey Wolf Optimizer, particle swarm optimization, and genetic algorithm, as confirmed through test cases.


List of symbols
Microgrids have become a cutting-edge method for tackling the challenges of contemporary energy systems, providing targeted and flexible capabilities for generating, distributing, and managing energy 1,2 .Microgrids, in contrast to conventional centralized grids, are decentralized networks capable of functioning alone or in tandem with the primary grid, offering enhanced resilience, reliability, and efficiency 3,4 .The incorporation of renewable energy sources (RESs), such as solar photovoltaics (PV) and wind turbines (WT), has played a crucial role in the advancement of microgrids 5,6 .Renewable energy sources provide environmentally friendly and sustainable methods of generating energy, hence decreasing dependence on fossil fuels and minimizing the release of greenhouse gases 7 .Furthermore, advancements in energy storage technologies, such as lithium-ion batteries and pumped hydro storage, have significantly enhanced the capacity of microgrids to store excess energy for subsequent use 8,9 .This advancement has led to a more stable power grid and improved integration of intermittent renewable sources 10,11 .The emergence of microgrid technology has paralleled the growing adoption of Plug-In Hybrid Electric Vehicles (PHEVs), presenting both opportunities and challenges in energy management 12,13 .PHEVs serve as both efficient and environmentally friendly modes of transportation, while also serving as mobile energy storage units 14,15 .When incorporated into microgrid operations, plug-in hybrid electric vehicles can actively engage in demand response programs, offer assistance to the grid, and function as alternative power sources in times of emergencies 16,17 .Addressing multi-objective energy management within a microgrid incorporating plugin electric vehicles (PEVs) represents a crucial and intricate challenge within the realm of energy systems 18,19 .
A microgrid is defined as a localized aggregation of electrical loads and distributed energy resources capable of functioning either in a grid-connected or standalone capacity [20][21][22] .PEVs are becoming increasingly popular as a means of reducing carbon emissions and dependency on fossil fuels 23 .The integration of PEVs into a microgrid creates a new set of challenges and opportunities for energy management 24,25 .PEVs offer the advantage of serving as mobile energy storage units, contributing flexibility and resilience to the microgrid 26 .However, the charging and discharging of PEVs require careful management to fulfill the energy demands of the microgrid while also addressing the requirements of individual PEV owners 27,28 .Multi-objective energy management in a microgrid incorporating PEVs entails the optimization of multiple competing objectives, including minimizing energy expenses, mitigating greenhouse gas emissions, and guaranteeing a dependable and resilient power provision [29][30][31] .This problem requires sophisticated algorithms and models that can handle the complexity and uncertainty of energy systems.Overall, multi-objective energy management in a microgrid with the integration of PEVs is an important and challenging problem that requires interdisciplinary research and collaboration between experts in energy systems, optimization, and control theory [32][33][34][35][36] .Its successful implementation can lead to significant benefits, including reduced energy costs, increased energy efficiency, and reduced carbon emissions 37,38 .
In 39 , a multi-objective economic dispatch model for microgrids incorporating electric vehicles and transferable loads was implemented.Simulation was carried out on four different case studies.The objective functions under consideration included the operational cost of the microgrid, the utilization rate of photovoltaic energy, and the power fluctuation between the microgrid and the utility 40 .A two-stage optimization strategy was implemented to perform the environmental and economic scheduling of microgrid with the integration of electric vehicles 41 .In our previous study 42 , we conducted multi-objective energy management in a microgrid integrating plug-in electric vehicles.The model suggested provided a state of charge curve for microgrids, considering the state of charge limits of plug-in electric vehicle batteries to prevent overcharging and over-discharging.Additionally, an enhanced grey wolf algorithm was proposed to address the multi-objective energy management problem.Moreover, in 43 , an adaptive simulated annealing particle swarm optimization algorithm (ASAPSO) was introduced for the multi-objective optimal scheduling of microgrids incorporating electric vehicles.The objective functions considered were operational cost and emissions.To strike a better balance between these objectives, coordination of renewable energy consumption and load management was achieved using the linear weighting method, grounded on a two-player zero-sum game.Microgrid energy management strategies with peak load reduction (PLR)-based demand response program was proposed to lower end-user energy costs and lower the peak load demand on the power grid 44 .The optimal management of a microgrid equipped with renewable energy sources and electric vehicles (EVs) alongside responsive loads has been undertaken to achieve cost savings and emissions reduction 45 .To address uncertainties stemming from wind turbine (WT) and photovoltaic (PV) power generation, a demand response program (DRP) was devised to manage required grid reserves.Furthermore, in 46 , an optimal microgrid operation considering charging patterns for plug-in hybrid electric vehicles (PHEVs) was proposed.To regulate the charging and discharging processes of PHEVs within the microgrid, along with responsive loads, a smart charging approach was recommended 46 .The study in 47 delved into the stochastic operation planning of a microgrid (MG) incorporating Battery Energy Storage System (BESS), renewable energies, and non-renewable energy sources.They devised a stochastic optimization model with a sole objective and proposed employing a hybrid approach combining the whale optimization algorithm with the pattern search algorithm to tackle the optimization challenge.An ideal energy management system for microgrids, incorporating distributed generation and electric vehicles, was proposed in 48 , aiming to reduce operational expenses and environmental pollutants.The optimization approach accounts for the performance of electric vehicles in both petrol and electric modes.In another study 49 , a scenario-based stochastic management approach is utilized to achieve the optimal operation of a multi-carrier microgrid (MG).This microgrid incorporates various components such as a wind turbine, photovoltaic panel, fuel cell, microturbine, boiler, combined heat and power unit, along with electrical, thermal, and hydrogen loads, as well as storage facilities for electrical energy, hydrogen, and thermal energy.To further reduce overall running costs, a novel approach for scheduling electric vehicles and battery storage in tandem while considering the demand response program (DRP) is proposed in 50 .Additionally, the impact of DRP collaboration and optimal scheduling of electric vehicles and energy storage systems on operational expenses, power transactions with the upstream grid, hourly distributed energy resources, and system technical parameters is explored.Finally, in 51 , a two-stage energy management framework employing stochastic chance constraint model predictive control (MPC) is introduced to solve the microgrid energy management problem with the integration of electric vehicles.The framework adopts a mixed-stage optimization approach, gradually optimizing the problem across various time scales.A detailed investigation into energy management systems (EMS) for microgrids was carried out, emphasizing EMS components and the optimization methodologies integrated into the EMS framework.Extensive literature review on microgrid energy management systems (EMS) was performed, categorizing them according to four criteria: the optimization methods employed, the grid type under consideration, the microgrid's operational mode (connected to the main grid or operating independently), and the software/solvers used as a basis for addressing EMS challenges 52 .An oppositional gradient-based grey wolf optimizer (OGGWO) was proposed to implement the multi-objective optimal scheduling of a microgrid 53 .Table 1 presents an overview of the research contributions in microgrid energy management covering objective functions, optimization methods, test system components, and notable remarks.Since its inception, the crystal structure algorithm has gained widespread popularity due to its remarkable adaptability, simple structure, and lack of predefined parameters.Despite CryStAl's superior performance in several areas, the crystal structure algorithm still has certain flaws.There is not enough exploration since CryStAl is sensitive to local extremes during iteration.To address the limitations of the crystal structure algorithm, we propose the Iterative Map Self-Adaptive Crystal Structure Algorithm (SaCryStAl).The efficacy of the proposed optimization technique was examined across three distinct scenarios to assess its performance.
The contribution to the knowledge section of this paper lies in several key areas.Firstly, we introduce a novel energy management technique tailored specifically for microgrids (MGs) integrated with renewable energy sources (RESs) and Plug-In Hybrid Electric Vehicles (PHEVs).This technique utilizes the SaCryStAl algorithm, which efficiently distributes energy among various units within the grid-connected MG.Secondly we address the dual objectives of minimizing MG operating costs and reducing pollutant emissions, a critical consideration in contemporary energy systems.By formulating an objective function that accounts for both economic and environmental factors, we provide a comprehensive framework for optimizing MG operation.Thirdly, we compare the performance of our proposed algorithm with existing evolutionary optimization approaches, demonstrating its superiority in terms of stability, convergence, and performance.Additionally, we present a true collection of Pareto-optimal solutions, offering system operators a range of options to tailor power dispatch strategies according to their economic and environmental objectives.Lastly, our study highlights the impact of widespread PHEV and RES adoption on grid functioning, underscoring the need for advanced optimization techniques in managing these complex systems.Overall, our contributions advance the field of sustainable energy • Presenting a multi-objective framework for the short-term scheduling of a microgrid (MG) incorporating a plug-in hybrid electric vehicle (PHEV), with cost and emissions as dual objective functions.• Incorporating the proposed SaCryStAl optimization technique to simultaneously minimize costs and emis- sions, generate Pareto optimal solutions, and determine the optimal compromise solution using a fuzzy satisfaction method.• The proposed SaCryStAl is investigated on three different scenarios including the operation of PHEVs' in three different modes.• The proposed SaCryStAl algorithm produced exceptional results when compared to recently published pub- lications in terms of cost, emission, and solution time.
The rest of the paper is structured as follows: In section "Iterative map-based self-adaptive crystal structure algorithm (SaCryStAl)", we delve into the implementation of the proposed Iterative map-based Self-Adaptive Crystal Structure Algorithm (SaCryStAl) to address the multi-objective energy management problem.Section "Modeling of a microgrid test system" is dedicated to the modeling of the microgrid test system under consideration.Section "Problem formulation" outlines the formulation of the multi-objective energy management problem aimed at minimizing operating costs and emissions.In section "Fuzzy logic-based selection of optimal compromise solution", we elaborate on the formulation of fuzzy logic assortment for determining the optimal compromise solution.The concept of microgrid modelling is covered in section "Uncertainty models for wind and solar energy".Lastly, section "Modeling of microgrid" presents a comprehensive demonstration of the superior performance and feasibility of the proposed SaCryStAl algorithm, juxtaposed with other meta-heuristic optimization algorithms such as FSAPSO, KH, PSO, WOA, GA and GWO.

Classical crystal structure algorithm (CryStAl)
The mathematical model of CryStAl, which applies the fundamental ideas of crystal formulation with the appropriate adjustments, is described in this part.All possible solutions to the optimization procedure are viewed as individual crystals in the solution space in this model.Initial crystals are generated randomly 74 .The idea of adding a basis to lattice points to create crystals served as the inspiration for the crystal structure algorithm.Siamak Talatahar suggested this crystal structure algorithm in 2021 based on this idea 75 .
The initial population is randomly generated within the bounds using Eq.(1).
where X i,j is the jth variable in the ith solution vector, where m is the problem's dimension and N is the number of crystals or potential solutions." r " is a random number between [0, 1], L j and U j are the variables, lower and upper bounds.The structure of the initial population matrix is shown in Eq. ( 2).
Based on the concept of 'basis' in crystallography, all the crystals at the corners are considered as the main crystals ( C rM ).The crystal with the best fitness value is taken as C rb and the mean values of randomly-selected crystals are denoted by F c .The new crystals are generated in the search space by using the following Eqs.(3-6).This process will be repeated for N number of iterations considered.
(i) Simple cubicle: (ii) Cubicle with the best crystals: (iii) Cubicle with the mean crystals: (iv) Cubicle with the best and mean crystals: where, in the four equations above, C rN is the new position, C rO is the old position, and r, r 1 , r 2 and r 3 are random numbers related to one another.

Steps involved in the proposed Iterative map-based self-adaptive crystal structure algorithm
Step 1 Generate N number of initial crystals X i,j using the Eq. (1)and find the opposite values for all the crystals X ij using the Eq. (7).
Calculate the fitness function value for all the crystals, arrange them in ascending order, and take the first N as the initial population size.
'a' represents a parameter that can be adjusted.Its value ranges from 0 to α.Based on our experience, the optimal value of 'a' is fixed as 0.48 and the starting rand ( r n ) value is 0.26.
(1) www.nature.com/scientificreports/ Step 3 Generate four new crystals using Eqs.(3-6) and find their opposite values using Eq. ( 7).Select the best crystal out of the eight newly created values and compare its fitness value with the fitness values of the initial population.If the best crystal replaces any one of the worst crystals in the initial population then maintain the r n values in the Eq. ( 3).Otherwise, generate a new value r n using Eq. ( 8).The detailed working mechanism of the proposed algorithm is given in Fig. 1.
Arbitrarily generate random values for the initial positions ( ) of initial crystals ( ) & Evaluate the fitness values for all crystals.Generate opposite values for all initial crystals and assess their fitness values.Combine the initial crystals with their opposites.Arrange them in ascending order based on their Select the initial population for subsequent iterations by taking the first N crystals Generate random " r " value using Iterative map (8 )

Generate
. Create a new crystal ( ) using ( 4) and its opposite values.Compute the fitness value for the new crystal and its counterpart.Retain the superior one.

Generate . Create a new crystal (
) using (5) and its opposite values.Determine the fitness values for both the new crystal and its opposite.Retain the one with the higher fitness value Generate .Create new crystal ( ) using (6) and its opposite values.Compute the fitness value for the new crystal and its counterpart.Retain the superior one.

Create new crystals (
) using (7) and its opposite values.Calculate the fitness values for both the new crystal and its counterpart.Preserve the one with the higher fitness value.

Pseudo-code of SaCryStAl
Initializing the positions of crystals C ij and C ij using (1) & (7).Calculate the fitness value for all the crystals.Generate random " r " value using Eq. ( 8) while N < N max do.for (every crystal) do.Create C rM .Create new crystals through formula (3) and its opposite value.Generate C rb .
Construct new crystals through formula ( 4) and its opposite value.Create F c .Create new crystals through formula ( 5) and its opposite value.Create new crystals through formula ( 6) and its opposite value.if (all the newly created crystal exceeds the limits) then adjust the location of the new crystal.end if.
Compute the fitness values for all the newly generated crystals.
Revise the population with the best fitness value.end for.N = N + 1. end while.Display the best crystal.
To assess the efficacy of the suggested algorithm, we select five standard mathematical test functions and proceed with its implementation.The outcomes from our method surpass those of the conventional approach and other methods referenced in Ref. 77 , while matching the performance of the ABC method in terms of quality.Table 2 presents the test data from applying the classical and proposed algorithm to benchmark functions.

Modeling of a microgrid test system
This research investigates a grid-connected microgrid (MG) comprising a wind turbine (WT), photovoltaic (PV) array, microturbine (MT), fuel cell (FC), storage battery, plug-in hybrid electric vehicles (PHEVs), and loads, connected to the main grid via a 20 kV/400 V transformer 78,79 .The microgrid configuration under study is adapted from the topology outlined in Ref. 78 .The PHEV represents a unique vehicle with various charging options and a transportation system enabling the use of fossil fuels during extended journeys if the battery's charge depletes 80,81 .Factors such as the state of charge (SOC) of the PHEV's battery, charger size, charging duration, and vehicle volume influence its charging rate 82,83 .Considering the unpredictable charging demands of these vehicles, our research encompasses multiple charging methods-coordinated, uncoordinated, and smart charging-to comprehensively characterize this phenomenon 84,85 .
In the initial charging pattern being examined, termed uncoordinated charging, the plug-in hybrid electric vehicles (PHEVs) have the flexibility to connect to the grid for charging at any time they desire 86,87 .These vehicles typically undertake two daily trips, with the first occurring in the morning and the second in the evening as they return home.Upon arriving home at 6:00 PM, it is assumed that the vehicles have the opportunity to connect to the grid for charging purposes.The probability density function (PDF) can be used to develop this 88 as follows: where a and b represent constants referring to the time.www.nature.com/scientificreports/ In the coordinated charging pattern, owners of plug-in hybrid electric vehicles (PHEVs) opt to connect their vehicles to the grid during off-peak hours to circumvent peak times and associated high prices.Consequently, they typically initiate charging sessions after 9:00 PM.This preference for off-peak charging is articulated in 88 .
In a smart charging pattern, PHEVs are connected to the grid when power prices are at their lowest or when energy is abundant 89 .This pattern can be represented using a standard PDF as seen below 88 : where µ and σ represent the standard deviation and mean respectively.
With the use of all-electric range (AER), the SOC of PHEVs during the charging process may be calculated as follows: Here, m represents the mileage of the PHEV in miles.Our study focuses on the PHEV-20 model, and charger availability data is sourced from 90 .We illustrate the charging process in residential areas using level 1 and level 2 chargers, which are the focus of this research.Level 3 chargers are designated for commercial and public transportation purposes.

Problem formulation
In this study, we introduce a precise mathematical model for short-term energy management aimed at minimizing operating costs and pollution emissions within a microgrid.Achieving optimal performance in a microgrid involves utilizing a multi-objective optimization approach.The key aim of multi-objective energy management in a typical microgrid setting is to identify the best power generation levels and determine the suitable operational states (ON or OFF) for distributed generation units.This process must optimize both the microgrid's operating costs and its net emissions, all while complying with predefined equality and inequality constraints.This study introduces a detailed mathematical model tailored for short-term energy management, aiming to cut costs and reduce emissions within the microgrid.

Objective functions
Optimizing both cost and emissions in a grid-connected microgrid is essential for balancing economic efficiency, environmental sustainability, regulatory compliance, and social responsibility.By targeting these goals simultaneously, microgrid operators can enhance their operations to benefit stakeholders and society at large.This study examines two key objective functions: operational costs and pollution emissions.

Operating cost
Operational costs form a foundational aspect of energy management strategies, significantly influencing their effectiveness and efficiency.These costs play a vital role in ensuring the economic sustainability and viability of microgrid operations 91 .Total operational expenses for the microgrid, calculated in Euro cents (€ct), encompass fuel costs for distributed generation units, startup and shutdown expenses, and costs associated with power exchange between the utility and the microgrid.The aim of managing overall operating costs is to achieve optimal power flow from energy sources to load centers over a given period, while prioritizing cost-effectiveness.
Operational costs contribute to bolstering the resilience and stability of microgrid systems.By accounting for factors such as fuel and maintenance expenses and penalties for deviations from operational constraints, these costs help identify robust energy management strategies that can endure uncertainties and disturbances, ensuring a reliable and continuous power supply 91 .www.nature.com/scientificreports/At hour h , the variables U PV , U WT , U MT , U FC , and U BT represent the operating states of the solar photovol- taic system, wind turbine, microturbine, fuel cell, and battery, respectively.Similarly, the bids for distributed generators (DGs), storage devices, and the grid at hour hr are denoted by B PV , B WT , B MT , B FC , B BT and B GR .The power outputs of the solar photovoltaic, wind turbine, microturbine, fuel cell, and battery unit at time h are represented by P PV (h) , P WT (h), P MT (h), P FC (h) and P BT (h) respectively.The start-up and shut-down costs of the solar photovoltaic, wind turbine, microturbine, fuel cell, and battery units are indicated by S PV , S WT , S MT , S FC and S BT respectively.Additionally, P GR (h) denotes the quantity of power traded with the market at hour hr, as referenced in 74,91 .
This study focuses on the design variables, which include the generated power outputs and the operating states of the generation units.The decision variables, consisting of the active power of the units and their corresponding states, are represented by the vector X , as defined in 91 .
Here N DG characterizes the number of distributed generators (DGs) installed in the microgrid (MG), whilst N ST signifies the number of storage units.

Objective function for pollution
The objective function for emissions is essential for evaluating the environmental impact of microgrid operations 92 .Microgrids emit pollutants due to various components such as the grid, generation units, and energy storage resources 93 .By quantifying emissions of pollutants such as CO 2 , SO 2 , and NO x , this function provides a comprehensive measure of the ecological footprint of energy generation and consumption within the microgrid.This is particularly significant in addressing climate change and mitigating air pollution, as it allows stakeholders to monitor and reduce the environmental effects of energy production 94 .The emissions objective function plays a crucial role in aligning energy management strategies with regulatory standards and sustainability goals.By incorporating emissions considerations into the optimization process, it supports compliance with emissions regulations and fosters proactive environmental stewardship.This helps microgrid operators avoid potential penalties and regulatory challenges while positioning them as leaders in promoting clean energy practices.Additionally, the emissions objective function enhances the overall efficiency and resilience of microgrid systems.By optimizing energy management strategies to minimize emissions while meeting operational needs, it encourages the adoption of cleaner and more sustainable technologies.The mathematical formula for calculating emissions, including nitrogen dioxide (NO x ), carbon dioxide (CO 2 ), and Sulfur dioxide (SO 2 ), is presented below 91 . Min Here E DGi (h) , E STj (h) , and E GR (h) denote the amount of pollutants from ith distributed generating unit, jth storage unit, and the market, at hour h , in kg/MWh correspondingly.
The emission variables are symbolized as follows 91 : Here CO 2 DG i (h) , SO 2 DG i (h) and NO x DG i (h) characterize the emissions of CO 2 , SO 2 , and NO x correspondingly from the ith DG sources during the hour h of the day.
Here CO 2 ST i (h) , SO 2 ST i (h) and NO x ST i (h) signify the emissions of CO 2 , SO 2 , and NO x correspondingly from the jth storage unit at hour h.

Load-generation balance
Here, P LLk represents the load magnitude of the kth load, whilst N KL denotes the total number of load levels present within the utility, as defined in Ref. 91 .

Generated power
The entire set of units, including the market, storage units, and distributed generators (DG), has defined lower and upper limits that regulate their power generation capacities, as described in Ref. 91 .The output power from the MG components should achieve the following constraints 53 .
The formula provided in Eq. ( 9) stipulates that the power generated from distributed generation (DG), battery, and grid sources must fall within their designated minimum and maximum limits, denoted by "min" and "max" respectively.

DGs' ramp rate constraints
This constraint pertains to the adjustment of the output power from distributed generators (DGs), describing the condition as follows 78 : where R i down and R i up are the ramp-down and ramp-up of the ith DG output power, respectively, and h is the time step in hours.

Battery charging/discharging states
To avoid the damage of the battery, the following constraint should be achieved 78,95 : where E min b represents the minimum stored energy in the battery while E max b denotes the maximum stored energy, P rated ch is the battery rated charge power, and P rated disch represents the battery rated discharge power during each time interval h.
The battery stored energy can be calculated as follows 78 : where ξ ch is the charging efficiency while ξ disch represents the discharging efficiency.
Here E b (h) and E b (h − 1) represent the energy stored in the battery at hours h and h − 1 , respectively.P ch is the permissible charging rate, while P disch is the permissible discharging rate during a specific time interval ( h ).The battery's charging and discharging efficiency are denoted by ξ ch and ξ disch respectively 96,97 .

Formulation of multi-objective energy management problem
The multi-objective energy management problem is formulated as follows: In this context, f T.C represents the objective function focused on cost minimization, while f T.E is the objec- tive function targeting emissions reduction.By integrating a price penalty factor (ρ), the multi-objective energy management problem can be transformed into a single-objective optimization problem, as shown in Eq. (26).The approach for determining the value of ρ is detailed in 98 . (30) P DGi,min (h) ≤ P DGi (h) ≤ P DGi,max (h) P STj,min (h) ≤ P STj (h) ≤ P STj,max (h) In this context, the weighting factor ' w ' signifies the degree of importance assigned to a specific objective function.With ' w ' set to 1, the optimization primarily emphasizes the reduction of operational costs.Conversely, assigning ' w ' a value of 0 prioritizes the minimization of emissions.In the context of multi-objective energy management, the ' w ' value is systematically reduced from 1 to 0, and at each decrement, a compromised solu- tion is generated.Ultimately, the best compromised solution (BCS) is determined using the fuzzy membership approach outlined in section "Fuzzy logic-based selection of optimal compromise solution", where a decrease in ' w ' leads to a simultaneous increase in operational costs and a reduction in pollutant emissions.

Fuzzy logic-based selection of optimal compromise solution
Before making a decision, it is crucial to determine the optimal compromise solution from the available set of optimal solutions 99,100 .To identify the best compromise solution, the author employed a fuzzy membership approach 101 .In jth objective function, f j of individual k is characterized by a membership function µ k j due to indefinite characteristic of decision maker's conclusion which is represented as follows 102 : where f max j denote the maximum value of jth fitness function while the latter's minimum value is represented by f min j in the pool of non-dominated solutions.Here, the normalized membership function µ k is also determined accordingly for each non-dominated solution k as follows 103 : Here, the overall number of non-dominated solutions is denoted by r.The best compromise solution is composed of maximum value, µ k .

Uncertainty models for Wind and Solar Energy
Different types of PDFs (Probability Density Function) have been deployed for the characterization of stochastic output power from the RESs.The wind turbine-based power relies upon the speed of the wind.As per the literature [104][105][106] , Weibull PDF forms the basis for wind speed probability.
Here, the shape parameter of Weibull PDF is denoted by α whereas corresponds to the scale of Weibull PDF.These variable values are sourced from the literature 104 .The following Eq.(41) shows the average of Weibull PDF.
The equation given below (25) describes the Ŵ function.
The fluctuations that occur in wind speed for the wind farm are shown in Fig. 2. As per the literature 7 , both scale and shape parameter values are decided.On the other hand, the PDF parameter values are chosen according to the study conducted earlier 104,107 .The aggregated rated output generated by the wind farm with capacity of 15 MW is achieved by connecting 5 wind generators in the considered microgrid test system.Each individual wind generator has a capacity of 3 MW.The subsequent Eq. ( 43) describes the power produced by the wind generators that relies upon the speed of the wind.
Here, P W r corresponds to a single turbine's rated power whereas the cut-in speed is denoted by v in .On the other hand, the cut-out speed is characterized by v out and the rated speed is denoted by v r .In this research work, various Weibull parameters are considered for the distribution of wind speed in line with literature 104,107 .From the wind generators, rated power is generated within the wind speed range that falls between the cut-in and cut-out thresholds.As per the literature 104,107 , the probability of such discrete zones is shown in the Eq. ( 44). ( 37) In continuous region, the probability distribution for wind power is as follows.
Likewise, the power generated by solar PV system completely relies upon the solar irradiance (G) that suits the guidelines as per lognormal PDF 104,107 .As per the literature 108 , the following equation shows the probability of solar irradiance with mean as well as standard deviation.
The subsequent Eq. ( 48) yields the mean of lognormal distribution ( M Lgn ) Figure 3 shows the frequency distribution for lognormal fitting and solar irradiance in case of simulating the Monte-Carlo scenario using 8,000 samples.The solar PV output power is expressed herewith.
In a standard environmental setting, solar irradiance is denoted as G std , with specific irradiance represented by R C .For G std , the value assumed is 800 W/m 2 , while R C is set at 120 W/m 2 .For the PV module, the rated output power P PVr is specified as 25 MW.

Modeling of microgrid
Utilizing individual distributed generators (DGs) can introduce numerous challenges, highlighting the importance of adopting a system approach.This approach treats generation and associated loads as a subsystem or microgrid 109,110 .By aggregating distributed generators (DGs) within a microgrid and harnessing renewable energies in large quantities, various issues related to economy, technology, and environment can be carefully studied within the target system, enabling informed decisions for improved operational management 111,112 .Furthermore, distributed generation encompasses a diverse array of prime mover technologies, including internal combustion (IC) engines, gas turbines, microturbines, photovoltaic systems, fuel cells, and wind power.These emerging technologies typically exhibit lower emissions and have the potential to achieve lower costs, thus challenging traditional economies of scale 78 .For instance, fuel cells, which generate electricity from hydrogen and oxygen, (44) primarily emit water vapor.However, during the reformation of natural gas or other fuels, they may produce some NO X and CO 2 emissions 113,114 .Despite their higher initial costs, fuel cells are generally more efficient and have lower emissions compared to microturbines.In this paper, a typical low-voltage (LV) microgrid is considered, incorporating various DGs such as microturbines (MT), low-temperature fuel cells (PAFC), photovoltaic (PV) arrays, wind turbines (WT), and storage devices like lead-acid batteries 78 .It is assumed that all DG sources generate active power at unity power factor without requesting or producing reactive power.Additionally, a power exchange link exists between the microgrid and the utility (LV network), facilitating energy trading throughout various hours of the day based on decisions made by the microgrid central controller (MGCC).

Results and discussion
The microgrid test system under examination comprises a distributor and various distributed generators (DGs), including photovoltaic panels (PV), wind turbines (WT), microturbines (MT), fuel cells (FC), and batteries 92 .In the proposed model, the objective function aggregates the total cost of the microgrid, encompassing power generation costs and startup/shutdown costs of units, in addition to the net emission of pollutants.This problem is addressed through three distinct scenarios.The primary case, where all units are dispatched based on their actual constraints.In the second scenario, both the wind turbine (WT) and solar photovoltaic (PV) systems operate at their maximum output levels.In the third scenario, the utility is treated as an unbounded unit that can exchange energy with the microgrid without any constraints.The total load demand within the microgrid for a typical day includes primarily residential areas, one industrial feeder serving a small workshop, and one feeder with light commercial consumers, as documented in Ref. 92 .The cumulative energy demand for the specified day amounts to 1695 kilowatt-hours (kWh).Furthermore, the study takes into account the real-time variation in energy prices in the market for the specified day, as documented in the earlier study 92 .To ensure the flexible operation of the microgrid, the optimization algorithm dynamically assigns "on" or "off " states to three distributed generation (DG) units-MT (Micro Turbine), PV (Photovoltaic), and WT (Wind Turbine)-during the power dispatch problem, considering both objectives.Similarly, since the microgrid operates in grid-connected mode, the utility is consistently set to the "on" state.In order to comprehensively evaluate the impact of the battery and PAFC (Proton Exchange Membrane Fuel Cell) on grid operation and to maximize the benefits of these resources, the "on" state is deliberately chosen for these respective units.The minimum and maximum generation limits of the DG sources are obtained from Ref. 92 .Furthermore, the bid coefficients in cents of Euro (€ct) per kWh, as well as emissions in kilograms per MWh, assumed by the DG sources, are extracted from Ref. 92 .To streamline our analysis, all units under consideration in this research study are assumed to operate exclusively in electricity mode, without requiring heat during the analyzed period.It's important to highlight that the enhanced integration of renewable energies stands as a key motivation behind micro-grid installations.In actual micro-grid operations, forecasts of future requirements are crucial for preparing flexible systems to respond appropriately.Although renewable energy may not follow traditional operational patterns, its behavior can be anticipated, and forecast information becomes crucial for optimizing system efficiency within microgrids.In this study, the power output of photovoltaic (PV) and wind turbine (WT) units is projected using an expert prediction model.However, this aspect falls beyond the scope of the current paper and will be addressed in future research.Table 3 provides an overview of the forecasted output of these units.The maximum allowable daily power extracted from the PV and WT are taken from the earlier study 92 .The daily load power and the energy market price in the typical micro-grid considered are taken from Ref. 92 .
To assess the effectiveness of the suggested SaCryStAl technique, a simulation is conducted comprising 50 trial runs aimed at minimizing operating costs.The controlling parameters of the proposed algorithm are selected as population size of 30 and maximum iteration of 1000 78 .The input data, including bids, technical coefficients, and emission coefficients of the DG sources for the microgrid test system under consideration, are sourced from www.nature.com/scientificreports/Ref. 92 .Five distributed generation (DG) sources with associated characteristics generate electricity within the micro-grid.Any excess or shortfall of energy within the grid is balanced through exchange with the utility at the point of common coupling.All units, including the utility sourced from the macro grid, are obliged to operate within their power limits while meeting specified constraints.The output power levels of the wind turbine and solar cell based on the predicted values are presented in Table 3 92 .

Case-I: operation of distributed energy sources within prescribed bounds
The first test case analyzed in this study entails operating all distributed generators (DGs) and the grid within predefined constraints, as detailed in Table 4. Furthermore, Table 4 illustrates the optimal generation schedule for 24 h aimed at minimizing both cost and emissions.It is evident from Table 4 that, following the new approach, a substantial portion of the load is initially supplied by the fuel cell within the grid and utility via the point of common coupling during the early hours of the day.This preference is due to the lower bids of these units compared to others during this timeframe.As demand and utility bids rise in subsequent hours, distributed generation (DG) units adjust their output levels based on priority, prioritizing lower costs and emissions accordingly.Consequently, DG units start up sequentially as requested by the micro-grid regulatory controller and energy import from the macro grid is replaced by export actions to enhance revenue and reduce net emissions during this period.Additionally, it's worth noting that battery charging occurs during the early hours when prices are low, while discharge actions are postponed to midday when the load curve peaks.Furthermore, leveraging renewable energy sources such as wind and solar reduces pollution but may increase the operating cost.Hence, the utilization of energy from these resources should be constrained, taking into account emission and economic factors.Tables 5 and 6 present the statistical outcomes of optimization algorithms, along with a concise comparison of their performances in the primary scenario.When evaluating performances based on both the best and worst solutions for cost and emission objectives, it becomes evident that the proposed optimization algorithm not only delivers superior outcomes but also demonstrates faster convergence.Additionally, statistical indices such as average and standard deviation further validate the algorithm's advantage in the optimization process.Tables 5  and 6 showcase standard deviation values for cost and emission objectives with the new algorithm limited to 0.006 and 0.005, respectively, indicating the excellent performance of the proposed model.By incorporating an oppositional population mechanism during the optimization process, the proposed algorithm explores further enhancements in both performance characteristics and optimal solutions.To provide a deeper insight into SaCryStAl's performance, the convergence characteristics of SaCryStAl and CryStAl algorithms for the best solution and each single objective are separately illustrated in Figs. 2 and 3.The operation cost was minimized by assigning the weighting factor w as unity.The proposed algorithm provides the least operation cost of 124.15 €ct compared with CryStAl, FSAPSO 91 , GA 91 , GWO 91 , PSO 91 , WOA 91 , and KH 91 .The optimization findings indicate  www.nature.com/scientificreports/ a close alignment between the minimum operating cost and its mean value, underscoring the precision of the proposed algorithm.By adjusting the weighting factor from 1 to 0, we achieved an optimal emission value of 419.14 kg.Figures 4 and 5 depict that the cost objective function reaches its minimum after around 670 iterations with the new method and remains stable thereafter, contrasting with the CryStAl algorithm, which converges in approximately 690 iterations.Similarly, the emission objective function reaches its minimum after about 428 iterations with the new method, while the CryStAl algorithm converges in about 417 iterations.Additionally, Fig. 6 highlights the superior performance of all mentioned algorithms when considering both objectives.Employing a fuzzy logic approach enabled the proposed algorithm to achieve the global best compromise solution for both generations cost and emission minimization.Figure 6 depicts the Pareto fronts of the respective trade-off objectives obtained from various comparison methods, alongside the best compromise solutions.Additionally, the distribution of non-dominated solutions along the Pareto optimal front, as observed in Fig. 6, validates the effectiveness of the proposed algorithm in addressing nonlinear multi-objective optimization problems.Moreover, the computational time for both operating cost and emission minimization using the proposed algorithm is notably shorter, indicating the high solution quality achieved.Overall, the optimization results strongly support the proposed algorithm's capability to address challenges related to equality and inequality in energy management problems.

Case-II: operation of microgrid with rated wind power
The WT is run at its rated power of 15 kW in the second scenario that is taken into consideration 115 .In this scenario, the proposed SaCryStAl is used to distribute the load to the MG components.While the PV generation is nil and the battery is in the charging stage, the MT, WT, FC, and grid actively contribute to meeting the  electrical load during the first eight hours.The PV began to share the load with the other mounted devices during the second interval.In this instance, extra electricity is sold to the grid.The load is supported during the last hours by WT, MT, FC, and battery 115 .Table 7 lists the best outcomes and statistical variables that were taken into account in this situation.Setting the weighting factor to 1 prioritizes the minimization of operating costs.Figure 7 illustrates the convergence characteristics achieved by SaCryStAl and CryStAl for operating cost minimization.
To minimize emissions, the weighting factor 'w' is set to 0, as shown in Fig. 8. SaCryStAl achieved the lowest operating cost of 53.92 €ct, while CryStAl yielded the maximum of 371.28 €ct.SaCryStAl also demonstrated  superior variance, standard deviation, and elapsed time.In terms of emissions, SaCryStAl produced the least at 135.186 kg, whereas CryStAl reached a maximum of 439.0481 kg.Detailed results are summarized in Tables 8  and 9. Decreasing the weighting factor 'w' from 1 to 0 in steps of 0.001 generates compromise solutions where operating costs increase and emissions decrease simultaneously.Tables 8 and 9 provide a statistical comparison of optimization results for operating cost and emissions, respectively.Through a fuzzy logic approach, the proposed algorithm achieved the global best compromise solution for both objectives.Figure 9 illustrates the trade-off relationship between operating cost and emissions achieved through the utilization of SaCryStAl and CryStAl algorithms.Table 10 presents the comparison of best comparison solution obtained using SaCryStAl, CryStAl and other optimization algorithms for Case I and II.The proposed SaCryStAl algorithm provided a better optimal solution compared to CryStAl.This aims to excel, particularly with the distinctly differentiated Pareto front achieved by SaCryStAl for complex nonlinear optimization problems.In terms of fitness value variation, the SaCryStAl performed well in both goals since it quickly arrived at the best answer.Additionally, SaCryStAl exhibited shorter computational times compared to other optimization algorithms.The optimization results strongly support SaCryStAl's capability to address the complexities of both equality and inequality present in  www.nature.com/scientificreports/microgrid energy management challenges, particularly with the incorporation of RES and PHEVs.The obtained simulation results showed excellent performance when WT was operating at its rated power.In this analysis, the integration of PHEVs with the microgrid is explored.It is assumed that 30% of the 70 EVs are linked to the MG 77 .The objective in this scenario is to minimize operating costs.Here, the uncoordinated, coordinated, and intelligent charging modes of PHEVs are investigated.The optimal generation schedule of microgrid with the integration of PHEVs for the minimization of operating cost for uncoordinated, coordinated and smart charging modes are presented in Tables 11, 12 and 13 respectively.In order to supply the PHEVs from the MG, there is a limitation in the utility generating to acquire the full power capabilities.When using coordinated and smart charging modes, there is less integration between MT and the grid.As a result, both modes' running costs are better than the uncoordinated charging mode's.According to Tables 11, 12 and 13, the FC serves as the primary energy source during the day, with the grid being used at night and in the morning.MT generation is roughly constrained.The RESs and batteries assist in meeting the demand at midday, and any extra electricity is then sold to the grid.In this case, the recommended energy management technique outperformed the other optimizers taken into consideration to produce the best operating costs for MG with PHEVs.

Conclusion and future research directions
This research implemented a new energy management technique for MGs with installed RESs and PHEVs that incorporates the SaCryStAl algorithm.The suggested method is accountable for distributing energy among many units.In the grid-connected MG, fuel cells, storage batteries, plug-in hybrid electric vehicles (PHEVs), nonrenewable sources (MT), and renewable generators (PV and WT) are all taken into consideration.The objectives taken into account in this effort include lowering the MG operating cost and reducing pollutant emission.In order to compare the performance of the proposed algorithm to currently used evolutionary optimization approaches, the study took into account three different scenarios.The research investigated three different scenarios to assess the effectiveness of the proposed algorithm compared to conventional CryStAl and other optimization techniques.The authors conducted simulations for each scenario and compared the results.In the first scenario, the SaCryStAl algorithm, designed for single-objective optimization, successfully achieved optimal solutions for cost and emissions, recording 124.15 €ct and 419.14 kg, respectively, within acceptable time frames of 97.19 and 76.41 s respectively.Optimization result surpassed those of other existing optimization algorithms.In the second scenario, the SaCryStAl algorithm once again provided superior results, delivering optimal cost and emission values of 53.92 €ct and 135.186 kg, respectively, within acceptable computational times of 551.684 and 597.062 s respectively.In the third scenario, the SaCryStAl algorithm maintained its success by achieving optimal operation costs of 319.9301 €ct, 160.9827 €ct, and 128.2815 €ct for the uncoordinated, coordinated, and smart charging modes of PHEVs, respectively.Moreover, the SaCryStAl algorithm demonstrated strong performance in optimizing both cost and emissions within a multi-objective framework.In the first scenario, it achieved optimal operational cost and emissions of 177.29 €ct and 469.92 kg respectively.In the second scenario, the algorithm produced even better results with optimal operational cost and emissions of 112.02 €ct and 196.15 kg respectively.The study's findings suggest that widespread use of PHEVs and RES will have a significant impact on grid functioning in terms of emission goals.The SaCryStAl algorithm demonstrates remarkable stability, convergence, and performance, as evidenced by the numerical results.Notably, it yields a diverse collection of Pareto-optimal solutions that are evenly distributed.This abundance of options empowers system operators to select the most suitable power dispatch strategy to meet their economic and environmental objectives effectively.Furthermore, our proposed method outperforms other optimization algorithms in terms of both economic and environmental outcomes.Remarkably, despite its superior performance, the computational time of our approach remains practically identical to that of the conventional CryStAl.Moreover, our current research extends beyond mere optimization by incorporating market pricing, load, photovoltaic (PV), and wind turbine (WT) uncertainties.This holistic approach ensures the optimal scheduling of microgrid operations, considering real-world uncertainties and enhancing the robustness of our findings.
In the future, a stochastic model that takes into account hydrothermal units as well as renewable energy sources could be offered.The proposed model's influence on pollutant emissions can be thoroughly examined, and market prices and tariff structures can also be taken into account.In considering future research directions, several promising avenues emerge from this study's findings.Firstly, further investigation into the integration of emerging technologies, such as advanced energy storage systems and demand response mechanisms, could enhance the efficiency and resilience of microgrid operations.Additionally, exploring the applicability of the proposed SaCryStAl algorithm in larger-scale energy systems and diverse geographical contexts would be beneficial.Furthermore, incorporating real-time data analytics and machine learning techniques could augment the www.nature.com/scientificreports/algorithm's decision-making capabilities, enabling more adaptive and proactive energy management strategies.Lastly, exploring the socio-economic implications of microgrid integration and assessing the potential barriers to adoption could provide valuable insights for policymakers and industry stakeholders.By addressing these research avenues, future studies can contribute to advancing the state-of-the-art in microgrid optimization and facilitating the transition towards sustainable and resilient energy systems.

Figure 2 .
Figure 2. Wind speed variation for wind farm.

Figure 4 .
Figure 4. Convergence characteristic for the minimization of operating cost (Case-I).

Figure 6 .
Figure 6.Trade-off characteristic between emissions and costs (Case-I).

Figure 7 .
Figure 7. Convergence characteristic for the minimization of operating cost (Case-II).

Figure 10 .
Figure 10.Convergence characteristic for the minimization of operating cost (uncoordinated charging mode).

Figure 11 .
Figure 11.Convergence characteristic for the minimization of operating cost (coordinated charging mode).

Figure 12 .
Figure 12.Convergence characteristic for the minimization of operating cost (smart charging mode).
The bid of the jth storage option during hour h B GR (h) The bid of grid during hour h S DGi Costs associated with starting up or shutting down the ith distributed generation (DG) unit S STj Costs associated with starting up or shutting down the jth storage unit E DGi (h) Emission in kg/MWh for ith distributed generation (DG) unit during hour h E STj (h) Emission in kg/MWh for jth storage unit during hour h E GRD (h) Emission in kg/MWh for grid during hour h CO 2 DG i (h) Carbon dioxide emissions from the ith distributed generation (DG) unit during hour h SO 2 DG i (h) Sulphur dioxide emissions from the ith distributed generation (DG) unit during hour h NO X DG i (h) Nitrogen oxide emissions from the ith distributed generation (DG) unit during hour h CO 2 ST j (h) Carbon dioxide emissions from the jth storage unit during hour h SO 2 ST j (h) Sulphur dioxide emissions from the jth storage unit during hour h NO X ST j (h) Nitrogen oxide emissions from the jth storage unit during hour h CO 2 GRD (h) Carbon dioxide emissions from the grid during hour h SO 2 GRD (h) Sulphur dioxide emissions from the grid during hour h NO X GRD (h) Nitrogen oxide emissions from the grid during hour h P LLk The quantity of the kth load level N KL Total number of load levels P DG,min (h) Minimum active power generation of ith DG during hour h P ST,min (h) Minimum active power generation of jth storage unit during hour h P GR,min (h) Minimum active power generation of grid during hour h P DG,max (h) Maximum active power generation of ith DG during hour h P ST,max (h) Maximum active power generation of jth storage unit during hour h P GR,max (h) Maximum active power generation of grid during hour h E b (h) Energy stored in the battery at time h P ch /P disch Rate of charge/discharge allowed over a specific timeframe.ξch /ξ disch Battery efficiency in the process of charging and discharging.Limits for the storage capacity of the battery, both minimum and maximum.P ch,max /P disch,max The highest permissible charge/discharge rate within each time segment, represented as the inertia weight parameter i (h) Status of unit i at hour h P DGi (h) Active power output of ith distributed generating unit at hour h P STj (h) Active power output of jth storage unit at hour h P GR (h) Active power exchanged with the grid through buying or selling at hour hr B DGi (h) The bid of the ith distributed generation (DG) source during hour h B STj (h)

Table 1 .
Exploring optimization strategies for energy management in microgrid: a review.

Table 2 .
Exploration of the proposed SaCryStAl algorithm to benchmark test functions.CM classical method & PM proposed method.
Here CO 2 GR (h) , SO 2 GR (h) and NO x GR (h) represent the emissions of CO 2 , SO 2 , and NO x correspondingly from the macro-grid or utility during the hour h of the day.

Table 4 .
Optimal generation schedule for minimization of operating cost and emission (Case-I).

Table 5 .
Statistical comparative results with other algorithms for minimization of operating cost (Case-I).

Table 6 .
Statistical comparison of results with other algorithms for emission minimization (Case-I).

Table 7 .
Optimal generation schedule for minimization of operating cost and emission (Case-II).

Table 8 .
Statistical analysis of optimization results for operating cost minimization (Case-II).

Table 9 .
Statistical analysis of optimization results for emission minimization (Case-II).

operation of microgrid integrated with PHEVs
Table 14presents the optimal value of the operation cost obtained using SaCryStAl and other optimization algorithms for the three different charging methods considered.It is evident from the optimization results, the proposed SaCryStAl performed better than CryStAl algorithm.In the uncoordinated, coordinated, and smart charging modes, the SaCryStAl algorithm attained optimal fitness values of 319.9301 €ct, 160.9827 €ct, and 128.2815 €ct, respectively.Figures10, 11and 12 present the convergence characteristics for the minimization of operating cost for uncoordinated, coordinated and smart charging modes respectively.The convergence behavior curve regarding operating cost minimization demonstrates that the proposed SaCryStAl algorithm exhibits smoother and more rapid convergence compared to the CryStAl algorithm across all three charging modes investigated.Moreover, Figs. 10, 11, and 12 illustrate that the SaCryStAl algorithm delivers swift and resilient performance, effectively mitigating optimization challenges encountered in diverse power systems.

Table 10 .
Comparison of best compromise solution for Case-I and Case-II.NA not available.

Table 11 .
Optimal generation schedule for minimization of operating cost for Case-III (uncoordinated charging).

Table 12 .
Optimal generation schedule for minimization of operating cost for Case-III (coordinated charging).

Table 13 .
Optimal generation schedule for minimization of operating cost for Case-III (smart charging).

Table 14 .
Analysis of simulation results for minimizing operating costs across three charging modes.